package com.ym.medical.service.impl;

import com.ym.core.utils.tkmybatis.BaseSVImpl;
import com.ym.medical.dao.DoctorVideoSettingDao;
import com.ym.medical.domain.entity.DoctorVideoSettingEntity;
import com.ym.medical.domain.param.DoctorVideoSettingUpdateParam;
import com.ym.medical.service.IDoctorVideoSettingSV;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
                                                                    
/**
* 医生视频咨询设置Service业务层处理
*
* @author ym
* @date 2020-09-14
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class DoctorVideoSettingSVImpl extends BaseSVImpl<DoctorVideoSettingEntity, DoctorVideoSettingDao> implements IDoctorVideoSettingSV {

	/**
	 * 新增医生视频咨询设置
	 *
	 * @param updateParam 医生视频咨询设置 新增参数
	 * @return 结果
	 */
	@Override
	public Long insertPC(DoctorVideoSettingUpdateParam updateParam) {
            DoctorVideoSettingEntity entity = updateParam.covert();
		this.insert(entity);
		return entity.getId();
	}

	/**
	 * 修改医生视频咨询设置
	 *
	 * @param updateParam 医生视频咨询设置 修改参数
	 * @return 结果
	 */
	@Override
	public int updateByIdPC(DoctorVideoSettingUpdateParam updateParam) {
            DoctorVideoSettingEntity entity = updateParam.covert("createTime");
		int result = this.updateById(entity);
		return result;
	}
}
